import java.util.*;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Question18 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        String temp = in.nextLine();
        String s = temp.substring(8);
        StringBuilder sb = new StringBuilder(s);
        sb.deleteCharAt(sb.length() - 1);

        String[] arrs = sb.toString().split(",");
        int[] nums = new int[arrs.length];

        for (int i = 0; i < arrs.length; i++) {
            nums[i] = Integer.valueOf(arrs[i]);
            // System.out.println(nums[i]);
        }

        int cnt = 0;

        for (int i = 0, j = 1; j < nums.length; ) {
            if (nums[i] >= nums[j]) {
                cnt++;
                j++;
            }
            else {
                i++;
                j++;
            }
        }

        System.out.println(cnt > 1 ? true : false);
        
    }
}